This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
~Michelle Chuabergings 26.Jan.04 05:08 PM a Web browser Domino Designer6.0.2 CF1All Platforms
I have two date fields on a form (startdate and enddate). Now I'm trying to populate a third date field with multiple values from that fields. The new entry can be a daterange or a single value (if startdate and enddate are the same). My problem is the syntax to get the new value into the existing array.
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim dtStart As NotesDateTime
Dim dtEnd As NotesDateTime
Dim item As NotesItem
Dim values As Variant
Dim dateRange As NotesDateRange
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
Set dtStart = New NotesDateTime(doc.getitemvalue("StartDate")(0))
If (doc.getitemvalue("EndDate")(0)<>"") Then
Set dtEnd = New NotesDateTime(doc.getitemvalue("EndDate")(0))
Else
Set dtEnd = dtStart
End If
Set dateRange = session.CreateDateRange()
Set dateRange.StartDateTime = dtStart
Set dateRange.EndDateTime = dtEnd
Set item = doc.GetFirstItem("Ferien_Daten")
If Not item Is Nothing Then
values = item.GetValueDateTimeArray()
End If
Dim ub As Integer
ub = Ubound(values)
Redim Preserve values(ub+1)
Set values(ub+1) = dateRange
doc.Ferien_Daten = values
Call uidoc.Refresh
So I use the new "GetValueDateTimeArray". The problem is if there's even one "single value" thats no daterange, the type of the values-array is notesdatetime and I get a type mismatch error with "Set values(ub+1) = dateRange". If there are only dateranges in the field the type of values is notesdaterange and it works. If I save the date field it shrinks a daterange with a single value to a datetime. So I get the error next time I try to populate the field. Has anybody an idea about that?